Reprinted from: Sina Blog(Watch archive contents: Cat, TAC, more, less, head, tail, NL, just what we mentioned just to show the appearance of the file, or to move and copy a file or directory, so what if we are going to inspect the contents of an
Recently, because of the front-end separation, PHP all APIs in the backend use RESTFul style.
However, PUT when using the upload file, found that $_FILES there is no file information (may not upload temporary files, to be verified), use POST is
Example code 1: Get content with file_get_contents in get
Copy CodeThe code is as follows:
$url = ' http://www.baidu.com/';
$html =file_get_contents ($url);
Print_r ($http _response_header);
EC ($html);
Printhr ();
Printarr ($http _response_header)
/** * get the contents of a remote file * @parma $url URL * @return Get content * **/ public static function getcontent ($url) {$flag = 0;do {$hCurl = curl_init (); curl_setopt ($hCurl, curlopt_header, 0);
One principle Difference
Generally in the browser to enter the URL access resources are through the get way, in form submission, you can specify the way to submit by using method for Get or post, the default is to submit
HTTP defines different
PHP read the file a variety of methods, come together to see it.One of the pleasures of dealing with modern programming languages such as PHP is that there are a number of options available. PHP can easily win Perl's motto "There's more than one
two methods of HTTP request: Get and POST
The two most commonly used methods for request-response between the client and the server are: Get and POST. Get-requests data from a specified resource. POST-submits the data to be processed to the
Original address: http://blog.csdn.net/csj50/article/details/5687850
a principle difference
Generally in the browser to enter the URL access to resources are through the Get method, in the form submission, you can specify the way to submit the
In the article "using WinHTTP to implement HTTP protocol get, post, and file upload", I have explained in more detail how to implement various protocols using the WinHTTP interface.In recent code grooming, I think the post and file upload modules
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.